/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: LiYansheng
 * @Date: 2022-04-23 21:44:49
 * @LastEditors: CoderXZ
 * @LastEditTime: 2022-05-04 11:03:29
 */

import request from '@/utils/request'

// 查询
export function search(form){
    return request({
        url:'/menu',
        method:'post',
        data:{
            name:form.name,
            pageIndex:form.pageIndex,
            pageSize:form.pageSize
        }
    })
}

// 添加
export function add(form){
    return request({
        url:'/menu/add',
        method:'post',
        data:{
            name:form.name,
            path:form.path,
            icon:form.icon,
            parent:form.parentName,
            status:form.status
        }
    })
}

// 删除
export function del(id){
    return request({
        url:'/menu/delete',
        method:'post',
        data:{
            id:id
        }
    })
}

// 修改
export function update(form){
    return request({
        url:'/menu/update',
        method:'post',
        data:{
            id:form.id,
            name:form.name,
            path:form.path,
            icon:form.icon,
            parent:form.parentName,
            status:form.status
        }
    })
}

// 批量删除
export function delList(ids){
    return request({
        url:'/menu/delList',
        method:'post',
        data:{
            ids:ids
        }
    })
}

// 获取已有菜单,可选为父级菜单
export function searchMenu(token){
    return request({
        url:'/menu',
        method:'get',
        // headers:{
        //     "token":token,
        // },
        
        
    })
}

